using UnityEngine;
using System.Collections;

public class Menu : MonoBehaviour {
	
	public Renderer thisRend;
	public Texture2D[] Animations;
	public bool isRun;
	public bool isCredits;
	public bool isRanking;
	public bool isBack;
	// Update is called once per frame
	void OnMouseEnter () 
	{
		if(isRun)
		thisRend.material.mainTexture = Animations[0];
		
		if(isCredits)
		thisRend.material.mainTexture = Animations[1];
		
		if(isRanking)
		thisRend.material.mainTexture = Animations[2];
		
		if(isBack)
		thisRend.material.mainTexture = Animations[6];
	}
	
	void OnMouseExit () 
	{
		if(isRun)
		thisRend.material.mainTexture = Animations[3];
		
		if(isCredits)
		thisRend.material.mainTexture = Animations[4];
		
		if(isRanking)
		thisRend.material.mainTexture = Animations[5];
		
		if(isBack)
		thisRend.material.mainTexture = Animations[7];
	}
	
	void OnMouseDown () 
	{
		if(isRun)
		Application.LoadLevel("Jogo");
		
		if(isBack)
		Application.LoadLevel("Menu");
		
		if(isCredits)
		Application.LoadLevel("Credits");
		
		if(isRanking)
		Application.LoadLevel("Ranking");
	}
}
